package com.example.myapplication.utils

import com.google.gson.Gson
import com.google.gson.JsonObject
import com.google.gson.JsonParser
import com.google.gson.reflect.TypeToken


object GsonUtils {
    fun jsonArr(jsonString: String): ArrayList<Map<String, Any>> {
        val bodyListType = object : TypeToken<ArrayList<Map<String, Any>>>() {}.type
        return Gson().fromJson(jsonString, bodyListType)
    }

    fun jsonObject(jsonString: String): JsonObject {
        return JsonParser.parseString(jsonString) as JsonObject
    }
}